<?php

namespace app\admin\config\role;
use app\common\model\AdminRole as DataMode;
class Info
{
    public function Model()
    {
        return new DataMode();
    }

    public function ListModel()
    {
        $Model=new DataMode();
        $DB=$Model->alias('a');
        return $DB;
    }

    public function InfoMode()
    {
        $data=[
            'app_id'=>'5',
            'app_num'=>'admin',
            'app_name'=>'后台管理',
            'mode_id'=>'11',
            'mode_num'=>'role',
            'mode_name'=>'角色管理',
            'database'=>'admin_role',
            'sub_database'=>[],        ];
        return $data;
    }

    public function InfoForm()
    {
        $data=[
            'power_field'=>[],
            'layout'=>[
                [
                    'field'=>'name',
                    'title'=>'角色名称',
                    'value'=>'',
                    'tag'=>'input',
                    'only'=>'2',
                    'required'=>'1',
                    'verify'=>'',
                ],
                [
                    'field'=>'num',
                    'title'=>'角色编码',
                    'value'=>'',
                    'tag'=>'input',
                    'only'=>'1',
                    'required'=>'1',
                    'verify'=>'isalpha',
                ],
                [
                    'field'=>'home',
                    'title'=>'默认首页',
                    'value'=>'',
                    'tag'=>'input',
                    'only'=>'2',
                    'required'=>'2',
                    'verify'=>'',
                ],
                [
                    'field'=>'notes',
                    'title'=>'备注',
                    'value'=>'',
                    'tag'=>'textarea',
                    'only'=>'2',
                    'required'=>'2',
                    'verify'=>'',
                ],
            ],
        ];
        return $data;
    }

    public function InfoLists()
    {
        $data=[
            'lists'=>[
                [
                    'name'=>'全部',
                    'num'=>'m_1713370157',
                    'page_num'=>'30',
                    'order_raw'=>'id desc',
                    'power_field'=>[],
                    'power_role'=>'',
                    'power_department'=>'',
                    'set_where'=>'',
                    'table_cols'=>[
                [
                    'field'=>'id',
                    'title'=>'主键',
                    'update'=>'',
                    'options'=>'',
                    'search'=>'',
                    'total'=>'2',
                ],
                [
                    'field'=>'name',
                    'title'=>'角色名称',
                    'update'=>'',
                    'options'=>'',
                    'search'=>'',
                    'total'=>'2',
                ],
                [
                    'field'=>'num',
                    'title'=>'角色编码',
                    'update'=>'',
                    'options'=>'',
                    'search'=>'',
                    'total'=>'2',
                ],
                [
                    'field'=>'home',
                    'title'=>'默认首页',
                    'update'=>'',
                    'options'=>'',
                    'search'=>'',
                    'total'=>'2',
                ],
                [
                    'field'=>'create_time',
                    'title'=>'创建时间',
                    'update'=>'',
                    'options'=>'',
                    'search'=>'',
                    'total'=>'2',
                ],
            ],

                ],
            ],
        ];
        return !empty($data['lists']) ? $data['lists'] : [];
    }

}